草庐IT

Swift、Parse 和 Xcode 6 beta6

全部标签

ios - Swift - HTTP 加载失败(通过 alamofire 上传图像时错误代码 : -1005 [4:-4]),。

我是iOS新手,使用Alamofire上传图片。我写的代码如下:letimage=imageView.imageletimgData=UIImageJPEGRepresentation(image!,0.2)!letheaders:HTTPHeaders=["x-access-token":"######","Accept":"application/json"]letparameters=["profile_picture":"kinza"]leturl=try!URLRequest(url:URL(string:"######")!,method:.post,headers:hea

iOS swift : Constraints did not update on screen

晚上,ScrollView约束有问题。这是我的代码://whenthekeyboardisshown,moveupsomeelements@objcfunckeyboardWillShow(notification:NSNotification){ifletkeyboardSize=(notification.userInfo?[UIKeyboardFrameEndUserInfoKey]as?NSValue)?.cgRectValue{//Bringupthescrollviewprint(scrollViewBottomConstraint.constant)self.scroll

ios - Swift 4 中的 mapView.setRegion

我在Swift4、Xcode9中的代码有问题。有人可以帮助我吗?当我运行这个程序时,它给我一个错误。它说mapView.setRegion(region,animated:true)不工作并给我一个错误,当我注释掉它时,它适用于我的当前位置,但只是没有紧密放大。funclocationManager(_manager:CLLocationManager,didUpdateLocationslocations:[CLLocation]){letlocation=locations[0]if!isInitialized{isInitialized=trueletspan:MKCoordin

ios - 从 xcode 中的 Assets 目录中获取图像名称列表

这个问题在这里已经有了答案:GetlistoffolderandfileswithinAssets.xcassets(1个回答)关闭5年前。我是xCode的新手。我想从Assets目录中的文件夹创建一个UIImage数组-请参见屏幕截图(“Brands”文件夹)。像这样将其加载到UITableView中:privatefuncloadLocalBrands(){//Loadimagesnamesfromassetsandaddthemtoarrayletnames:[String]=["Avon","Dove","Faberlic","Grand","GreenLight","Lore

ios - bamboo xcode 单元测试 - 找不到工作区

我正在尝试在Bamboo中实现自动ios单元测试。但我得到错误:AppIOS.xcworkspace不存在。退后一步:我尝试通过shellscript运行我的单元测试。xcodebuild\-workspaceAppIOS.xcworkspace\-schemeApp-IOS\-sdkiphonesimulator\-destination'platform=iOSSimulator,name=iPhone6,OS=9.3'\test|xcpretty这很好。所以我尝试将其“翻译”成Bamboo。这是我的配置。在我开始我的单元测试之前,我用'-ls'打印目录的内容在互联网上我找不到最新

ios - Swift 3 和 Firebase 观察 Child 是否存在

需要观察我的Firebase数据库中的一个节点(如果它存在)。我使用的代码是这样的:varCOLOR_REF=Database.database().reference().child("Colors")self.COLOR_REF.child(id).observe(.childAdded){(snapshot)inletkey=snapshot.keyApi.Post.getMyPosts(withId:key,completion:{(post)incompletion(post)})}id可能存在也可能不存在...我需要的是执行观察ifchild(id)existelsedos

ios - 在 Swift 4.0 中获取上个月趋势存储库时出错 - Github API

我正在将以下curl翻译成Swift但不幸的是,我在PlayGround上运行时遇到以下错误:Optional(["errors":({code=invalid;field=q;message="\"`date\"isnotarecognizeddate/timeformat.PleaseprovideanISO8601date/timevalue,suchasYYYY-MM-DD.";resource=Search;}),"documentation_url":https://developer.github.com/v3/search/,"message":ValidationFa

【k8s】k8s 集群 kubelet日志报错 command failed“ err=“failed to parse kubelet flag: unknown flag: --network-p

项目场景:服务器异常断电后在k8s集群getnodes出现E040815:31:50.40095423612memcache.go:265]couldn'tgetcurrentserverAPIgrouplist:Get"https://192.168.0.20:6443/api?timeout=32s":dialtcp192.168.0.20:6443:connect:connectionrefused问题描述查看kubelet服务状态systemctlstatuskubelet.service发现服务处于loaded状态,kubelet.serviceenteredfailedstate.

ios - 带有 UICollectionView 的 UITableViewCells 低性能(Swift)

我有一个tableview,每个单元格中嵌套了一个collectionView。tableViewCell的数量是动态的,每个tableViewCell的collectionViewCell的数量也是动态的。我“dequeueReusableCell”这两种细胞。每次加载tableViewCell时,我都会执行cell.collectionView.reloadData()。当我滚动TableView时,它真的很乱。此外,viewController需要大量加载。我试图在uitableviewcell的prepareforReuse或willDisplayCell中移动collecti

ios - 使用 AVCaptureVideo 在 Swift 中捕获 240 fps 的视频

我想在我的iPhone显示屏上看到240fps的视频预览。我的代码(简单)是这样的(如下):进行session,激活相机,并在显示屏上显示实际的视频预览。varsession:AVCaptureSession?varstillImageOutput:AVCaptureStillImageOutput?varvideoPreviewLayer:AVCaptureVideoPreviewLayer?overridefuncviewDidLoad(){super.viewDidLoad()super.viewWillAppear(true)session=AVCaptureSession()